package com.commerce.weather.utils;

import android.content.Context;

import com.commerce.weather.R;

import okhttp3.Call;
import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;

public class CallLocation {
     public Call location(String location, Context context) {
         FormBody formBody = new FormBody.Builder()
                 .add("city",location)
                 .add("key",context.getResources().getString(R.string.myID))
                 .build();
         Request request = new Request.Builder()
                 .url("http://apis.juhe.cn/simpleWeather/query")
                 .post(formBody)
                 .build();
         Call call = new OkHttpClient().newCall(request);

         return call;
     }
}
